package edu.bbu.commonproject.backend.server.model;

/**
 * The directory POJO class.
 */
public class DirectoryPOJO
{
	/** The owner's name. */
	private String owner;
	
	/** The directories name. */
	private String directoryName;
	
	/** The parent directory. */
	private String parrentDirectory;
	
	/**
	 * Sets the owner name.
	 * @param owner the owner name.
	 */
	public void setOwner(String owner)
	{
		this.owner = owner;
	}
	
	/**
	 * Gets the owner name.
	 * @return the owner name.
	 */
	public String getOwner()
	{
		return owner;
	}
	
	/**
	 * Sets the directory name.
	 * @param directoryName the directory name.
	 */
	public void setDirectoryName(String directoryName)
	{
		this.directoryName = directoryName;
	}
	
	/**
	 * Gets the directory name.
	 * @return the directory name.
	 */
	public String getDirectoryName()
	{
		return directoryName;
	}

	/**
	 * Gets the parrent directory name.
	 * @return the parrent directory name.
	 */
	public String getParrentDirectory()
	{
		return parrentDirectory;
	}

	/**
	 * Sets the parrent directory name.
	 * @param parrentDirectory the parrent directory name.
	 */
	public void setParrentDirectory(String parrentDirectory)
	{
		this.parrentDirectory = parrentDirectory;
	}

	/**
	 * It sets the hash code.
	 */
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((directoryName == null) ? 0 : directoryName.hashCode());
		result = prime * result + ((owner == null) ? 0 : owner.hashCode());
		result = prime * result + ((parrentDirectory == null) ? 0 : parrentDirectory.hashCode());
		return result;
	}

	/**
	 * It check the status and return it.
	 */
	public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if (obj == null)
		{
			return false;
		}
		if (getClass() != obj.getClass())
		{
			return false;
		}
		
		DirectoryPOJO other = (DirectoryPOJO) obj;
		
		if (directoryName == null)
		{
			if (other.directoryName != null)
			{
				return false;
			}
		}
		else if (!directoryName.equals(other.directoryName))
		{
			return false;
		}
		if (owner == null)
		{
			if (other.owner != null)
			{
				return false;
			}
		}
		else if (!owner.equals(other.owner))
		{
			return false;
		}
		if (parrentDirectory == null)
		{
			if (other.parrentDirectory != null)
			{
				return false;
			}
		}
		else if (!parrentDirectory.equals(other.parrentDirectory))
		{
			return false;
		}
		
		return true;
	}
}
